package com.ics.cmsadmin.modules.sso.utils;

import com.ics.cmsadmin.modules.auth.bean.SysUser;
import com.ics.cmsadmin.modules.basic.bean.StudentBean;
import com.ics.cmsadmin.modules.sso.LoginInfo;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by 666666 on 2018/8/25.
 */
@AllArgsConstructor
public enum  LoginTypeEnum {
    CMS_ADMIN_WEB(SysUser.class),
    CMS_ADMIN_WEB_TOKEN(SysUser.class),
    WECHAT_CODE_LOGIN(StudentBean.class);

    @Getter
    private Class<? extends LoginInfo> userInfoClass;

    public static LoginTypeEnum valueOfType(String type){
        try {
            return LoginTypeEnum.valueOf(type);
        }catch (IllegalArgumentException e){
            return null;
        }
    }

}
